package day6;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

/**
 * @author oldliu
 * @since 1.0
 */
public class FileRead5 {
    public static void main(String[] args) {
        InputStream in = null;
        try {
            in = new FileInputStream("F:\\java82\\zhangliangmu\\作业.txt");
            System.out.println(in.available()+">>>>");
            //in.skip(4);//跳过4个
            byte b[]=new byte[in.available()];
            int length=in.read(b);//一步读完
            String str=new String(b,0,length);
            System.out.println(in.available()+">>>>");//0
            System.out.println(str);
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                if (in != null)
                    in.close();
            } catch (IOException e) {

            }
        }

    }
}
